﻿using dotHTML.HTML;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;
#pragma warning disable 0618
namespace TestdotHTML
{
    
    
    /// <summary>
    ///This is a test class for IFrameTest and is intended
    ///to contain all IFrameTest Unit Tests
    ///</summary>
    [TestClass()]
    public class IFrameTest {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext {
            get {
                return testContextInstance;
            }
            set {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for IFrame Constructor
        ///</summary>
        [TestMethod()]
        public void IFrameConstructorTest() {
            IFrame target = new IFrame();
            Assert.AreEqual("<iframe></iframe>", target.ToString());
        }

        /// <summary>
        ///A test for Align
        ///</summary>
        [TestMethod()]
        public void AlignTest() {
            IFrame target = new IFrame();
            Nullable<IFrame.Alignment> expected = IFrame.Alignment.Bottom;
            Nullable<IFrame.Alignment> actual;
            target.Align = expected;
            actual = target.Align;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for FrameBorder
        ///</summary>
        [TestMethod()]
        public void FrameBorderTest() {
            IFrame target = new IFrame();
            Nullable<bool> expected = false;
            Nullable<bool> actual;
            target.FrameBorder = expected;
            actual = target.FrameBorder;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Height
        ///</summary>
        [TestMethod()]
        public void HeightTest() {
            IFrame target = new IFrame();
            string expected = string.Empty;
            string actual;
            target.Height = expected;
            actual = target.Height;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for LongDesc
        ///</summary>
        [TestMethod()]
        public void LongDescTest() {
            IFrame target = new IFrame();
            string expected = string.Empty;
            string actual;
            target.LongDesc = expected;
            actual = target.LongDesc;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for MarginHeight
        ///</summary>
        [TestMethod()]
        public void MarginHeightTest() {
            IFrame target = new IFrame();
            Nullable<int> expected = 1;
            Nullable<int> actual;
            target.MarginHeight = expected;
            actual = target.MarginHeight;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for MarginWidth
        ///</summary>
        [TestMethod()]
        public void MarginWidthTest() {
            IFrame target = new IFrame();
            Nullable<int> expected = 1;
            Nullable<int> actual;
            target.MarginWidth = expected;
            actual = target.MarginWidth;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Name
        ///</summary>
        [TestMethod()]
        public void NameTest() {
            IFrame target = new IFrame();
            string expected = string.Empty;
            string actual;
            target.Name = expected;
            actual = target.Name;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Sandbox
        ///</summary>
        [TestMethod()]
        public void SandboxTest() {
            IFrame target = new IFrame();
            Nullable<IFrame.SandboxChoices> expected = IFrame.SandboxChoices.AllowForm;
            Nullable<IFrame.SandboxChoices> actual;
            target.Sandbox = expected;
            actual = target.Sandbox;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Scrolling
        ///</summary>
        [TestMethod()]
        public void ScrollingTest() {
            IFrame target = new IFrame();
            Nullable<IFrame.ScrollingChoices> expected = IFrame.ScrollingChoices.Auto;
            Nullable<IFrame.ScrollingChoices> actual;
            target.Scrolling = expected;
            actual = target.Scrolling;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Seamless
        ///</summary>
        [TestMethod()]
        public void SeamlessTest() {
            IFrame target = new IFrame();
            bool expected = false;
            bool actual;
            target.Seamless = expected;
            actual = target.Seamless;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Src
        ///</summary>
        [TestMethod()]
        public void SrcTest() {
            IFrame target = new IFrame();
            string expected = string.Empty;
            string actual;
            target.Src = expected;
            actual = target.Src;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for SrcDoc
        ///</summary>
        [TestMethod()]
        public void SrcDocTest() {
            IFrame target = new IFrame();
            string expected = string.Empty;
            string actual;
            target.SrcDoc = expected;
            actual = target.SrcDoc;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Width
        ///</summary>
        [TestMethod()]
        public void WidthTest() {
            IFrame target = new IFrame();
            string expected = string.Empty;
            string actual;
            target.Width = expected;
            actual = target.Width;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ToStringTest() {
            IFrame i = new IFrame("src");
            i.Align = IFrame.Alignment.Bottom;
            i.FrameBorder = true;
            i.Height = "10%";
            i.LongDesc = "longdesc";
            i.MarginHeight = 1;
            i.MarginWidth = 2;
            i.Name = "name";
            i.Sandbox = IFrame.SandboxChoices.AllowForm | IFrame.SandboxChoices.AllowSameOrigin |
                IFrame.SandboxChoices.AllowScripts | IFrame.SandboxChoices.AllowTopNavigation;
            i.Scrolling = IFrame.ScrollingChoices.Auto;
            i.Seamless = true;
            i.SrcDoc = "srcdoc";
            i.Width = "11%";
            Assert.AreEqual("<iframe align=\"bottom\" " +
                "frameborder=\"1\" " +
                "height=\"10%\" " +
                "longdesc=\"longdesc\" " +
                "marginheight=\"1\" " +
                "marginwidth=\"2\" " +
                "name=\"name\" " +
                "sandbox=\"allow-form allow-same-origin allow-scripts allow-top-navigation \" " +
                "scrolling=\"auto\" " +
                "seamless=\"seamless\" " +
                "src=\"src\" " +
                "srcdoc=\"srcdoc\" " +
                "width=\"11%\"></iframe>", i.ToString());
        }
    }
}
